package com.ymatou.iapi.userservice.testcase;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonObject;
import com.ymatou.iapi.userregister.parameter.UserRegisterInfoRequestDtoBean;
import com.ymatou.iapi.userregister.service.UserRegisterInfoRequestDtoCall;
import com.ymatou.iapi.userservice.parameter.UserRequestDtoBean;
import com.ymatou.iapi.userservice.parameter.enums.AppSourceEnum;
import com.ymatou.iapi.userservice.parameter.req.CreateUserReq;
import com.ymatou.iapi.userservice.parameter.req.QueryUserReq;
import com.ymatou.iapi.userservice.service.UserRequestDtoCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.database.model.YmtUsers;
import com.ymttest.database.sqlwapper.JUserWapper;
import com.ymttest.database.sqlwapper.YmtUsersWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.constant.ECode;
/**
*查询用户推荐接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_UserRequestDto{
	private static UserRequestDtoBean userrequestdtoBean;
	private static UserRequestDtoCall userrequestdtoCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("查询用户推荐接口");
	}

	@Before
	public void caseUp() {
		userrequestdtoBean=new UserRequestDtoBean();
		userrequestdtoCall=new UserRequestDtoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(userrequestdtoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_001() {
		Logger.start(true,"成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.defaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			Logger.verifyEquals(cur.getRegSource().getText(),re.get("regSourceText").getAsString(), "验证regSourceText");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_UserRequestDto_002() {
		Logger.start(true,"不输入用户ID，成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();				
			
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_UserRequestDto_003() {
		Logger.start(false,"不输入用户ID和登陆ID，失败");
		try {
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			
			Logger.verifyIsContains("请求参数非法", userrequestdtoCall.getString("LastErrorMessage"), "验证Msg信息");
			Logger.verifyEquals("100", userrequestdtoCall.getString("ResponseCode"), "验证Code");
			Logger.verifyEquals("false", userrequestdtoCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_UserRequestDto_004() {
		Logger.start(true,"只用userid成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			userrequestdtoBean.setIUserId(uid);
//			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
//			userrequestdtoBean.setIncludeIdCard(true);
//			userrequestdtoBean.setIncludeLevel(true);
//			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_UserRequestDto_005() {
		Logger.start(true,"邮箱注册用户成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			cur.setMobile(null);
			int uid = JUserCallService.createUserCall(cur);
//			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getMail());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
//			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_UserRequestDto_006() {
		Logger.start(true,"用邮件成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getMail());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_007() {
		Logger.start(true,"loginid成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
//			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
//			userrequestdtoBean.setIncludeIdCard(true);
//			userrequestdtoBean.setIncludeLevel(true);
//			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_008() {
		Logger.start(true,"loginid小写成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
//			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId().toLowerCase());
//			userrequestdtoBean.setIncludeIdCard(true);
//			userrequestdtoBean.setIncludeLevel(true);
//			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_UserRequestDto_009() {
		//http://userservice.iapi.ymatou.com/json/reply/UserRequestDto?iUserId=&LoginKeyWord=82987654321&IncludeLogoUrl=false&IncludeIdCard=false&IncludeLevel=false
		Logger.start(true,"兼容报文成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
//			userrequestdtoBean.setIUserId("");
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false)+"&iUserId=");
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_010() {
		Logger.start(true,"成功查询出用户信息,带头像");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String imgurl="http://www.ymatou.com/def.jpg";
			JUserCallService.SetUserLogoCall(uid, imgurl);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(imgurl,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_011() {
		Logger.start(true,"loginid成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			new JUserWapper().updateLoginId(uid, "12345677");
			
			//id
			userrequestdtoBean.setLoginKeyType(0);
			userrequestdtoBean.setLoginKeyWord("12345677");
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			
			//调用完成后删除这个异常数据
			new JUserWapper().deleteUserinfoByUid(uid);
			new JUserWapper().deleteUserinfoexByUid(uid);
			
			
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals("12345677",re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.oldDefaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_012() {
		Logger.start(true,"loginmail成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			//loginmail
			userrequestdtoBean.setLoginKeyType(2);
			userrequestdtoBean.setLoginKeyWord(cur.getMail());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.oldDefaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_013() {
		Logger.start(true,"mobile成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			//mobile
			userrequestdtoBean.setLoginKeyType(1);
			userrequestdtoBean.setLoginKeyWord(cur.getMobile());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.oldDefaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	//用户loginid为数字 不传LoginKeyType 先查询mobile 没查到再查loginid
	public void Tc_UserRequestDto_014() {
		Logger.start(true,"loginid为数字成功查询出用户信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			new JUserWapper().updateLoginId(uid, "12345679");
			
			//id
//			userrequestdtoBean.setLoginKeyType(0);
			userrequestdtoBean.setLoginKeyWord("12345679");
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			
			//调用完成后删除这个异常数据
			new JUserWapper().deleteUserinfoByUid(uid);
			new JUserWapper().deleteUserinfoexByUid(uid);
			
			
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals("12345679",re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.oldDefaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_015() {
		Logger.start(true,"成功查询出用户备注信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			JUserCallService.SetRemark(uid, "Remark");
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.defaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("Remark"), "Remark非空");
			Logger.verifyEquals("Remark",userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("Remark").getAsString(), "验证Remark");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_016() {
		Logger.start(true,"成功查询出用户等级信息");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			JUserCallService.ExpChange(uid, 2);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.defaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			Logger.verifyEquals(2,userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("iLevel").getAsInt(), "验证iLevel");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_017() {
		Logger.start(true,"用户被锁定无法查询");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			JUserCallService.ExpChange(uid, 2);
			
			JUserCallService.lockUsers(uid);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("100002",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("false",userrequestdtoCall.getString("Success"), "验证Success");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_018() {
		Logger.start(true,"setOutputLockUser为true时,用户被锁定可以查询");
		try {
			CreateUserReq cur=new CreateUserReq();
			cur=JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			
			JUserCallService.ExpChange(uid, 2);
			
			JUserCallService.lockUsers(uid);
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoBean.setOutputLockUser(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(cur.getLoginId(),re.get("sLoginId").getAsString(), "验证LoginId");
			Logger.verifyEquals(cur.getMobile(),re.get("sLoginMobile").getAsString(), "验证LoginMobile");
			Logger.verifyEquals(cur.getMail(),re.get("sLoginEmail").getAsString(), "验证LoginMail");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("TPas"), "获取T非空");
			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sPassword"), "sPassword非空");
//			Logger.verifyNotNull(userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("sTradingPassword"), "sTradingPassword非空");
			//"sUserLogoUrl":JUserCallService.defaultImg 验证默认头像
			Logger.verifyEquals(JUserCallService.defaultImg,re.get("sUserLogoUrl").getAsString(), "验证sUserLogoUrl");
			Logger.verifyEquals(2,userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject().get("iLevel").getAsInt(), "验证iLevel");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	//验证全部的AppSourceEnum 手工执行
	public void Tc_UserRequestDto_019() {
		Logger.start(true,"成功查询出用户信息-增加字段regSourceText");
		try {
			AppSourceEnum[] alist = AppSourceEnum.values();
			for (AppSourceEnum appSourceEnum : alist) {
				CreateUserReq cur=new CreateUserReq();
				cur=JUserCallService.initCreateUserBean(cur);
				cur.setRegSource(appSourceEnum);
				int uid = JUserCallService.createUserCall(cur);
				userrequestdtoBean.setIUserId(uid);
				userrequestdtoBean.setLoginKeyWord(cur.getLoginId());
				userrequestdtoBean.setIncludeIdCard(true);
				userrequestdtoBean.setIncludeLevel(true);
				userrequestdtoBean.setIncludeLogoUrl(true);
				userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
				userrequestdtoCall.callService();	
				Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
				Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
				JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
				Logger.verifyEquals(cur.getRegSource().getText(),re.get("regSourceText").getAsString(), "验证regSourceText");
			}
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UserRequestDto_020() {
		Logger.start(true,"成功查询出用户信息-新增字段ClientIp,ClientPort");
		try {
			UserRegisterInfoRequestDtoBean urb = JUserCallService
					.initUserRegisterInfoRequestDtoBean();
			urb.setClientPort("9999");
			UserRegisterInfoRequestDtoCall uc = JUserCallService
					.UserRegisterInfoRequestDtoCall(urb);

			Integer uid = uc.getUserid();
			userrequestdtoBean.setIUserId(uid);
			userrequestdtoBean.setIncludeIdCard(true);
			userrequestdtoBean.setIncludeLevel(true);
			userrequestdtoBean.setIncludeLogoUrl(true);
			userrequestdtoCall.setData(FormatUtil.beanToHttpString(userrequestdtoBean, true, false));
			userrequestdtoCall.callService();	
			Logger.verifyEquals("200",userrequestdtoCall.getString("ResponseCode"), "验证ResponseCode");
			Logger.verifyEquals("true",userrequestdtoCall.getString("Success"), "验证Success");
			
			JsonObject re = userrequestdtoCall.getJsonObject().get("Result").getAsJsonObject();
			Logger.verifyEquals(uid,re.get("iUserId").getAsInt(), "验证iUserId");
			Logger.verifyEquals(urb.getClientIp(),re.get("ClientIp").getAsString(), "验证ClientIp");
			Logger.verifyEquals(urb.getClientPort(),re.get("ClientPort").getAsString(), "验证ClientPort");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}